/*
**
** $VER: Toolbar_mcc.h V15.6
** Copyright © 1997-00 Benny Kjær Nielsen. All rights reserved.
**
** Translated into D by Miklós Németh
**
*/

/*** Include stuff ***/

MODULE 'libraries/mui'
MODULE 'utility/tagitem'

CONST BKN_SERIAL =$fcf70000


/*** MUI Defines ***/

#define MUIC_Toolbar 'Toolbar.mcc'
#define ToolbarObject MUI_NewObjectA(MUIC_Toolbar,[TAG_IGNORE, 0

/*** Methods ***/

#define MUIM_Toolbar_BottomEdge      (BKN_SERIAL | $07)
#define MUIM_Toolbar_CheckNotify     (BKN_SERIAL | $0d)
#define MUIM_Toolbar_DrawButton      (BKN_SERIAL | $0c)
#define MUIM_Toolbar_KillNotify      (BKN_SERIAL | $02)
#define MUIM_Toolbar_KillNotifyObj   (BKN_SERIAL | $03)
#define MUIM_Toolbar_LeftEdge        (BKN_SERIAL | $08)
#define MUIM_Toolbar_MultiSet        (BKN_SERIAL | $04)
#define MUIM_Toolbar_Notify          (BKN_SERIAL | $01)
#define MUIM_Toolbar_Redraw          (BKN_SERIAL | $05)
#define MUIM_Toolbar_ReloadImages    (BKN_SERIAL | $0b)
#define MUIM_Toolbar_RightEdge       (BKN_SERIAL | $09)
#define MUIM_Toolbar_Set             (BKN_SERIAL | $06)
#define MUIM_Toolbar_TopEdge         (BKN_SERIAL | $0a)

/*** Method OBJECTs ***/

OBJECT MUIP_Toolbar_CheckNotify
    MethodID:ULONG,
    TrigButton:ULONG,
    TrigAttr:ULONG,
    TrigValue:ULONG

OBJECT MUIP_Toolbar_Edge
    MethodID:ULONG,
    Button:ULONG

OBJECT MUIP_Toolbar_KillNotify
    MethodID:ULONG,
    TrigButton:ULONG,
    TrigAttr:ULONG

OBJECT MUIP_Toolbar_KillNotifyObj
    MethodID:ULONG

OBJECT MUIP_Toolbar_MultiSet
    MethodID:ULONG,
    Flag:ULONG,
    Value:ULONG,
    Button:LONG

OBJECT MUIP_Toolbar_Notify
    MethodID:ULONG,
    TrigButton:ULONG,
    TrigAttr:ULONG,
    TrigValue:ULONG,
    DestObj:PTR TO _Object,
    FollowParams:ULONG

OBJECT MUIP_Toolbar_Redraw
    MethodID:ULONG,
    Changes:ULONG

OBJECT MUIP_Toolbar_ReloadImages
    MethodID:ULONG,
    Normal:PTR TO UBYTE,
    Select:PTR TO UBYTE,
    Ghost:PTR TO UBYTE

OBJECT MUIP_Toolbar_Set
    MethodID:ULONG,
    Button:ULONG,
    Flag:ULONG,
    Value:ULONG

/*** Special method values ***/

CONST MUIV_Toolbar_Set_Ghosted     =$04
CONST MUIV_Toolbar_Set_Gone        =$08
CONST MUIV_Toolbar_Set_Selected    =$10

CONST MUIV_Toolbar_Notify_Pressed    =0
CONST MUIV_Toolbar_Notify_Active     =1
CONST MUIV_Toolbar_Notify_Ghosted    =2
CONST MUIV_Toolbar_Notify_Gone       =3
CONST MUIV_Toolbar_Notify_LeftEdge   =4
CONST MUIV_Toolbar_Notify_RightEdge  =5
CONST MUIV_Toolbar_Notify_TopEdge    =6
CONST MUIV_Toolbar_Notify_BottomEdge =7

/*** Special value for MUIM_Toolbar_Notify ***/

CONST MUIV_Toolbar_Qualifier =$49893135

/*** Special method flags ***/

/*** Attributes ***/

#define MUIA_Toolbar_Description     (BKN_SERIAL | $16 )
#define MUIA_Toolbar_HelpString      (BKN_SERIAL | $17 )
#define MUIA_Toolbar_Horizontal      (BKN_SERIAL | $15 )
#define MUIA_Toolbar_ImageGhost      (BKN_SERIAL | $13 )
#define MUIA_Toolbar_ImageNormal     (BKN_SERIAL | $11 )
#define MUIA_Toolbar_ImageSelect     (BKN_SERIAL | $12 )
#define MUIA_Toolbar_ImageType       (BKN_SERIAL | $10 )
#define MUIA_Toolbar_ParseUnderscore (BKN_SERIAL | $18 )
#define MUIA_Toolbar_Path            (BKN_SERIAL | $1b )
#define MUIA_Toolbar_Permutation     (BKN_SERIAL | $1a )
#define MUIA_Toolbar_Qualifier       (BKN_SERIAL | $1c )
#define MUIA_Toolbar_Reusable        (BKN_SERIAL | $19 )

/*** Special attribute values ***/

CONST MUIV_Toolbar_ImageType_File     =0
CONST MUIV_Toolbar_ImageType_Memory   =1
CONST MUIV_Toolbar_ImageType_Object   =2

/*** OBJECTures, Flags & Values ***/

CONST TP_SPACE =-2
CONST TP_END   =-1

OBJECT MUIP_Toolbar_Description
  Type:UBYTE,               /* Type of button - see possible values below (TDT_). */
  Key:UBYTE,                /* Hotkey */
  Flags:UWORD,              /* The buttons current setting - see the TDF_ flags */
  ToolText:PTR TO UBYTE,    /* The text beneath the icons. */
  HelpString:PTR TO UBYTE,  /* The string used for help-bubbles or MUIA_Toolbar_HelpString */
  MutualExclude:ULONG       /* Buttons to be released when this button is pressed down */


/*** Toolbar Description Types ***/

CONST TDT_BUTTON  =0
CONST TDT_SPACE   =1
CONST TDT_IGNORE  =2 // Obsolete
CONST TDT_END     =3

CONST TDT_IGNORE_FLAG =128

/*** Toolbar Description Flags ***/

CONST TDF_TOGGLE      =$01 /* Set this if it's a toggle-button */
CONST TDF_RADIO       =$02 /* AND this if it's also a radio-button */
CONST TDF_GHOSTED     =$04
CONST TDF_GONE        =$08 /* Make the button temporarily go away */
CONST TDF_SELECTED    =$10 /* State of a toggle-button */

#define TDF_RADIOTOGGLE (TDF_TOGGLE|TDF_RADIO) /* A practical definition */

/* TDF_RADIO and TDF_SELECTED only makes sense
   if you have set the TDF_TOGGLE flag.          */

/*** Toolbar Macros ***/

#define Toolbar_Button(flags, text)          [ TDT_BUTTON, NIL, flags, text, NIL, NIL]:MUIP_Toolbar_Description
#define Toolbar_KeyButton(flags, text, key)  [ TDT_BUTTON, key,  flags, text, NIL, NIL]:MUIP_Toolbar_Description
#define Toolbar_Space                        [ TDT_SPACE,  NIL, NIL,  NIL, NIL, NIL]:MUIP_Toolbar_Description
#define Toolbar_End                          [ TDT_END,    NIL, NIL,  NIL, NIL, NIL]:MUIP_Toolbar_Description


